package org.shopen.ai.puremvc.view.common
{
	import org.puremvc.as3.patterns.mediator.Mediator;
	import org.shopen.ai.puremvc.ApplicationConstants;
	import org.shopen.ai.puremvc.view.common.components.IntroWindow;
	import org.shopen.ai.puremvc.view.project.ProjectSelectorMediator;

	public class IntroWindowMediator extends Mediator
	{
		public static const NAME : String = "IntroWindowMediator";
		
		public function IntroWindowMediator(viewComponent:Object=null)
		{
			super(IntroWindowMediator.NAME, viewComponent);
		}
		
		override public function getMediatorName():String
		{
			return IntroWindowMediator.NAME;
		}
		
		override public function onRegister():void
		{
			facade.registerMediator(new ProjectSelectorMediator(introWindow.projectSelector));
			introWindow.author = "Andriy Shafran, AMi-41";
			introWindow.organizationTitle = "Artificial Intelligence";
			sendNotification(ApplicationConstants.REQUEST_PROJECTS_META);
		}
		
		protected function get introWindow() : IntroWindow
		{
			var result : IntroWindow = viewComponent as IntroWindow;
			return result;
		}
	}
}